0 is a valid CR3 value; CR3_EADDR isn't but there's nothing stopping a
guest from putting it in its VMCB. The special case was broken anyway
since AFAICT "p2m->cr3" is a nester-cr3 (i.e. p2m-table) value and
guest_cr[3] is an actual-cr3 (pagetable) value.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
struct p2m_domain *p2m;
int i;
- if (cr3 == 0 || cr3 == CR3_EADDR)
- cr3 = v->arch.hvm_vcpu.guest_cr[3];
+ /* Mask out low bits; this avoids collisions with CR3_EADDR */
+ cr3 &= ~(0xfffull);
if (nv->nv_flushp2m && nv->nv_p2m) {
nv->nv_p2m = NULL;